import {TYPES} from '../reducers/appReducers';
import sqlite from '../utils/sqlite';

export function changeNum(){
    return (dispatch,getState)=>{
        let {app} = getState();
        dispatch({
            type:TYPES.CHANGENUM,
            num:++app.num
        })
    }
}

export function transcation(){
    return (dispatch,getState)=>{
        sqlite.transaction((ctx)=>{
            ctx.executeSql("select * from settings where type=?",["0"],(ctx,res)=>{
                console.log(res.rows.raw())
            },(e)=>{
                console.log(e)
            })
        })
    }
}